<template>
    <el-time-select
            v-model="currentValue"
            :disabled="disabled"
            class="commonDate"
            :picker-options="pickerOptions"
            placeholder="选择时间"
            size="small"
            @change="onChange">
    </el-time-select>
</template>
<script>
    export default {
        currentValue: String,
        oldValue: String,

        data() {
            return {
                currentValue: this.value,
            };
        },

        watch: {
            value(val, oldValue) {
                this.setCurrentValue(val);
            },
        },



        created: function () {

        },

        methods: {
            setCurrentValue(val) {
                this.currentValue = val;
            },

            handleClick(evt) {
                this.$emit('click', evt);
            },

            onChange() {
                const me = this;
                me.$emit('input', me.currentValue);
                me.$emit('value', me.currentValue);
            },
        },

        props: {
            placeholder: {
                type: String,
                default: ''
            },
            value: {
                type: String
            },
            pickerOptions:{
                type: Object
            },
            disabled: {
                type: Boolean,
                default: false
            }
        },
    }
</script>
